import { request } from "../request";

export interface Statistic {
    today: number;
    pastSevenDays: number;
    pastFifteenDays: number;
}

export const getApiStatistic = async (url: string) => {
    try {
        return await request<Statistic>("/stats/used-times", {
            urlName: url,
        });
    } catch (err) {
        throw err;
    }
};

export const getVisitStatistic = async () => {
    try {
        return await request<Statistic>("/stats/uv", null);
    } catch (err) {
        throw err;
    }
};
